<?php if($models != null):?>
<?php foreach($models as $n=>$model):?>
<?php echo $this->renderPartial('application.views.detail._item', array('model'=>$model,'n'=>$n,'edit'=>$edit)); ?>
<?php endforeach;?>
<?php endif;?>
<script type="text/javascript">
  $(".old").click(function(){
    var id = $(this).attr('id');
    var el ="#old_details_"+id;
    $(el).html('fast');
    $.ajax({
         type: "POST",
         url: "<?php echo Yii::app()->urlManager->createUrl("detail/getForEditing") ?>",
         data: "id="+id,
         success: function(msg){
           $(el).replaceWith(msg);
         }
       });
  });
</script>